import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java .util.Scanner;

public class EnterTest
{
	public static void main(String[] args)
	{
		CharTest(); //调用System.in方法
		ReadTest();//调用ReadTest方法
		ScannerTest();

	}

	public static void CharTest()
	{
		try
		{
			System.out.println("Enter a char:");
			char i = (char) System.in.read();
			System.out.println("Your Enter is " + i);
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
	}

	public static void ReadTest()
	{
		System.out.println("Read test, pls enter data:");
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		try
		{
			String name = br.readLine();
			System.out.println("Read Test out put : " + name);
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
	}

	public static void ScannerTest()
	{
		Scanner sc = new Scanner(System.in);
		System.out.println("Scanner Test, pls enter Name:");
		String name = sc.nextLine();
		System.out.println("Please enter your age:");
		int age = sc.nextInt();
		System.out.println("Please enter your salary:");
		float salary = sc.nextFloat();
		System.out.println("Your informationis as below:");
		System.out.println("name: " + name + " Age: " + age + " Salary: " + salary);
	}
}